<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>

    <meta charset="UTF-8">
    <title>物资入库</title>
    <script th:src="@{/js/jquery.min.js}"></script>
    <style>
        .greenStyle {
            background: lightgreen;
        }
    </style>
    <script>

        function SureSH() {
            var fbarcode = document.getElementById("fbarcode").value;
            var cargoSpaceId = document.getElementById("cargoSpaceId").value;
            var trayCode = document.getElementById("trayCode").value;
            if (fbarcode == "" || fbarcode == null) {
                alert("物资条码不能为空！");
                return;
            }
            if (cargoSpaceId == "" || cargoSpaceId == null) {
                alert("货位编号不能为空！");
                return;
            }
            if (trayCode == "" || trayCode == null) {
                alert("托盘号不能为空！");
                return;
            }
            $.post("/pdaPk1/barcodesave", {
                fbarcode: fbarcode,
                cargoSpaceId:cargoSpaceId,
                trayCode:trayCode
            }, function (result) {
                alert(result.res);
                document.getElementById("fbarcode").value ="";
                entertext();
            }, "json");
        }
        function entertext() {
            document.getElementById("fbarcode").focus()
        }
    </script>
</head>
<body>
<table id="tbb" width="98%" border="1" align="center" cellPadding="0" cellSpacing="0">
    <tr>
        <td align="right">货位编码:</td>
        <td><input id="cargoSpaceId" type="text" name="cargoSpaceId" style="width: 100%"/>
        </td>
    </tr>
    <tr>
        <td align="right">托盘编码:</td>
        <td><input id="trayCode" type="text" name="trayCode" style="width: 100%"/>
        </td>
    </tr>
    <tr>
        <td align="right">子件条码:</td>
        <td><input id="fbarcode" type="text" name="fbarcode" style="width: 100%" oninput="SureSH()"/>
        </td>
    </tr>

    <tr>
<!--        <td height="25" bgcolor="#d9e8fc" align="center" colSpan="2">-->
<!--            <table width="100%">-->
<!--                <tr>-->
<!--                    <td width="60%" align="center">-->
<!--                        <button id="btn_submit2" type="button" onclick="SureSH()" style="width:30%;"> 提交</button>-->
<!--                    </td>-->
<!--                </tr>-->
<!--            </table>-->
<!--        </td>-->
    </tr>
</table>
</body>
</html>